enforce stable aws endpoint for cartopy_feature_download.py#1837
Merged
greglucas merged 2 commits intoSciTools:masterfrom Sep 3, 2021
Merged
enforce stable aws endpoint for cartopy_feature_download.py#1837greglucas merged 2 commits intoSciTools:masterfrom
greglucas merged 2 commits intoSciTools:masterfrom
Conversation
stickler-ci
reviewed
Sep 3, 2021
bjlittle
commented
Sep 3, 2021
| config['pre_existing_data_dir'] = args.output | ||
| config['data_dir'] = args.output | ||
| target_dir = pathlib.Path(args.output).expanduser().resolve() | ||
| target_dir.mkdir(parents=True, exist_ok=True) |
Member
Author
There was a problem hiding this comment.
The exist_ok flag was added in Python 3.5, so I assume it's okay to use here...surely 😜
Contributor
There was a problem hiding this comment.
I guess you'll just get an error if you want to try with an earlier Python version ;)
Member
Author
|
@greglucas awesome, thanks 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is related to #1833 and the ability to download
cartopyfeature resources from the now preferred stable AWS endpoint.The now renamed
tools/cartopy_feature_download.py(#1602) onmasteronly requires a one line change to ensure that this script works with almost all older versions ofcartopy, see line +142. Thus removing the need to backport this fix. Clearly there is community appetite for this to happen given #1834.We have a live use case on SciTools/iris, see here, where we want the benefits of using #1833 to download and populate a
cartopycache for our CI. As it happens, the fix proposed here works with an installedcartopyv0.18.Initially, we worked around the issue by crafting the change solely within
iris, but there is a bigger win for thecartopycommunity here rather than limiting the win withinirise.g., downloading this PR version ofcartopy_feature_download.pywill work for older immutable production versions ofcartopyto populate the cache and avoid downloading resources on demand.The benefits of this PR is also not dependant on conda-forge/cartopy-feedstock#116, which only helps users of
cartopy_feature_download.pywithcartopyv0.19.0.post1 and onwards.Closes #1834